<template>
  <div>
    <h3>我是B组件(发布方)</h3>
    <button @click="clickSend">发布通知</button>
    BaseTwo
  </div>
</template>

<script>
import Bus from '../utils/EventBus'

export default {
  name: 'BaseTwo',
  methods: {
    clickSend() {
      // 3.B组件(发送方)触发事件的方式传递参数(发布消息)
      Bus.$emit('sendMsg', '不想在中软呆了,想离职!!!')
    }
  },
}
</script>

<style scoped>
div {
  border: 3px solid red;
  margin: 30px;
}
</style>